package homelesspartners.client.widgets;

import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Widget;

public class SponsorsWidget extends Composite {

	private static SponsorsWidget instance = new SponsorsWidget();
	
	public static SponsorsWidget getInstance() {
		return instance;
	}


	public SponsorsWidget() {

		FlexTable table = new FlexTable();
		table.setWidth("200px");

		Hyperlink ashbySolutions = new Hyperlink("<img border='0' src='./images/ashby.jpg' />", true, "");
		ashbySolutions.addClickListener(new ClickListener() {

			public void onClick(Widget sender) {
				Window.open("./AshbySolutionsContact.html", "_blank", "");
			}
		});
		
		table.setWidget(0, 0, new HTML("<br /><br /><br /><br /><br />"));
		table.setWidget(1, 0, ashbySolutions);
		table.getFlexCellFormatter().setAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_BOTTOM);
		table.setWidget(2, 0, new HTML("<br /><a target='_blank' href='http://rimuhosting.com/landing.jsp?s=ilink11'><img border='0' src='http://rimuhosting.com/images/promo/rimu_apache_style_102_47.png' alt='Java and Linux VPS Hosting by RimuHosting' /></a>"));
		table.getFlexCellFormatter().setAlignment(2, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_BOTTOM);
		
		initWidget(table);
	}

}
